<?php 
session_start();
require_once("ini.php");

function headerPage($title="Thai Oriental Beauty"){
	global $branchScreen , $card_couponScreen ,$serviceScreen
	,$customerScreen ,$discountScreen
	,$productScreen,$unitScreen
	,$categoryScreen,$positionScreen
	,$supplierScreen,$userScreen
	,$userGroupScreen,$stockScreen
	,$orderScreen,$receiveScreen
	,$returnScreen,$posScreen
	,$top_sale_report,$daily_sale_report
	,$monthly_sale_report,$yearly_sale_report
	,$quarter_sale_report,$course_diff_report
	,$return_product_report,$branch_order_report,$account_report
	,$header_office_report ,$customer_information_report;
	
		$html="<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
		'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
		<html xmlns='http://www.w3.org/1999/xhtml' lang='en' xml:lang='en'>
		<head>
			<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
			<title>".$title."</title>
			<link href='css/jquery-ui-1.8.9.custom.css' rel='stylesheet' type='text/css' />
			<SCRIPT src='js/jquery-1.4.4.min.js'></SCRIPT> 
			<SCRIPT src='js/jquery-ui-1.8.9.custom.min.js'></SCRIPT> 
			<script type='text/javascript' src='./js/superfish.js'></script>
			<script type='text/javascript' src='./js/custom.js'></script>
			<script type='text/javascript' src='./js/jquery.paginate.js'></script>
			<link rel='stylesheet' type='text/css' href='css/menustyle.css' />     
			<link href='css/style.css' rel='stylesheet' type='text/css' />
		</head>
	<body class='layout1014'>
	<INPUT type=hidden value='".$_SESSION['userid']."' id='m_userId' name='m_userId'> 
	<INPUT type=hidden value='".$_SESSION['branchtype']."' id='m_isHo' name='m_isHo'> 
	<div id='normal-screen'>
	<div id='dialog-Account' style='z-index:9999;font-size:12px;font-family:tahoma;display:none;'>
	<p class='validateTips' style='color:red'>* fields are required.</p>
	<form>
	<table cellpadding='2' cellspacing='5' border='0' width='100%' class='fieldset'>
		<tr>
			<td width='25%'><label for='name' style='font-weight:bold' >User Name *</label></td>
			<td width='75%'><input type='text' name='AccUserName'  id='AccUserName' style='border:1px solid #ccc;padding:4px;font-size:12px;width:80%' /></td></tr>
		<tr>
			<td  ><label for='name' style='font-weight:bold'>Password *</label></td>
			<td  ><input type='password' name='AccPassword'  id='AccPassword' style='border:1px solid #ccc;padding:4px;font-size:12px;width:80%' /></td></tr>
		<tr>
			<td  ><label for='name' style='font-weight:bold'>Frist Name *</label></td>
			<td  ><input type='text' name='AccFirstName'  id='AccFirstName' style='border:1px solid #ccc;padding:4px;font-size:12px;width:80%' /></td>
		</tr>
		<tr>
			<td  ><label for='name' style='font-weight:bold'>Last Name </label></td>
			<td  ><input type='text' name='AccLastName'  id='AccLastName' style='border:1px solid #ccc;padding:4px;font-size:12px;width:80%' /></td>
		</tr>
		<tr>
			<td  ><label for='name' style='font-weight:bold'>Email * </label></td>
			<td  ><input type='text' name='AccEmail'  id='AccEmail' style='border:1px solid #ccc;padding:4px;font-size:12px;width:80%' /></td>
		</tr>		
		<tr>
			<td><label for='name' style='font-weight:bold'>Telephone * </label></td>
			<td><input type='text' name='AccTelephone'  id='AccTelephone' style='border:1px solid #ccc;padding:4px;font-size:12px;width:80%' /></td>
		</tr>			
		<tr>
			<td><label for='name' style='font-weight:bold'>Position</label></td>
			<td><select name='AccPositionID' style='width:15em;font-size:12px;padding:5px;'  id='AccPositionID' /></td></tr>
		<tr>
			<td><label for='name' style='font-weight:bold'>Group</label></td>
			<td ><select style='width:15em;font-size:12px;padding:5px;' name='AccGroupID'  id='AccGroupID' /></td></tr>
		<tr>
			<td><label for='name' style='font-weight:bold'>Branch</label></td>
			<td ><select style='width:15em;font-size:12px;padding:5px;border:1px solid #ccc;'   name='AccBranchID'  id='AccBranchID'  /></td></tr>
		<tr>
			<td><label for='status' style='font-weight:bold'>Status </label></td>
			<td><input type='checkbox' name='AccIsActived' id='AccIsActived' value='' checked /><label for='status' style='font-weight:normal'>Actived</label></td>
		</tr>
		<tr class='tr_ac_sms'>
			<td><label for='status' style='font-weight:bold'>SMS </label></td>
			<td><input type='checkbox' name='AccSMS' id='AccSMS' value='' checked />
				<label for='status' style='font-weight:normal'>Received SMS from Branch</label>
			</td>
		</tr>
	</table>
	</form>
	</div>
	</div>
	<div id='page_wrapper' >
		<div id='page-header'>
			<div id='page-header-wrapper' class='fixed'>
				<div id='top'>
					<!--a href='mainscreen.php' class='logo' title='Thai Oriental Beauty' style='width:222px'>Thai Oriental Beauty</a-->
				</div>
				<div class='welcome'>
				<span class='note'>Welcome, <a href='#' title='Welcome, ".$_SESSION['username']."'>".$_SESSION['username']."</a></span>
					<a class='btn ui-state-default ui-corner-all' href='#' id='btnAccount'>
						<span class='ui-icon ui-icon-person'></span>
						My account
					</a>
					<a class='btn ui-state-default ui-corner-all' href='logout.php'>
						<span class='ui-icon ui-icon-power'></span>
						Logout
					</a>						
				</div>
				<ul id='navigation' >
					<li>
						<a href='mainscreen.php' class='sf-with-ul'>Home</a>
						<ul>
							<li><a href='mainscreen.php'>Dashboard</a></li>
							";
							 if($_SESSION["permission"][$posScreen]["View"]=="1"){
							$html.="<li><a href='pos.php'>POS</a></li>";
							}
							$html.="
						</ul>
					</li>
					<li>";
				 
					
					if ($_SESSION['branchtype']==1){
						$html.=	"<li><a href='#' class='sf-with-ul'>Master</a><ul>";
						 if($_SESSION["permission"][$branchScreen]["View"]=="1"){
							$html.=	"<li><a href='branch.php'>Branch Maintenance</a></li>";
						} if($_SESSION["permission"][$card_couponScreen]["View"]=="1"){ 
							$html.=	"<li><a href='card_coupon.php'>Card & Coupon Maintenance</a></li>";							
						} if($_SESSION["permission"][$customerScreen]["View"]=="1"){ 		
							$html.=	"<li><a href='customer.php'>Customer Maintenance</a></li>";
						} if($_SESSION["permission"][$discountScreen]["View"]=="1"){ 		
							$html.=	"<li><a href='ex_discount.php'>Discount Maintenance</a></li>";		
						} if($_SESSION["permission"][$productScreen]["View"]=="1"){ 	
							$html.=	"<li><a href='product.php'>Product Maintenance</a></li>	";
						} if($_SESSION["permission"][$categoryScreen]["View"]=="1"){ 	
							$html.=	"<li><a href='category.php'>Product Category Maintenance</a></li>";	
						} if($_SESSION["permission"][$unitScreen]["View"]=="1"){ 		
							$html.=	"<li><a href='unit.php'>Product Unit Maintenance</a></li>";
						} if($_SESSION["permission"][$positionScreen]["View"]=="1"){ 	
							$html.=	"<li><a href='position.php'>Position Maintenance</a></li>";							
						} if($_SESSION["permission"][$supplierScreen]["View"]=="1"){ 		
							$html.=	"<li><a href='suppliers.php'>Suppliers Maintenance</a></li>";
						} if($_SESSION["permission"][$userScreen]["View"]=="1"){ 	
							$html.=	"<li><a href='user.php'>User Maintenance</a></li>";				
						} if($_SESSION["permission"][$userGroupScreen]["View"]=="1"){ 		
							$html.=	"<li><a href='usergroup.php'>User Group Maintenance</a></li>";
						}		
					
						$html.="</ul></li>";
					}
					
					$html.="<li><a href='#'>Report</a><ul>";
					 if($_SESSION["permission"][$customer_information_report]["View"]=="1"){ 	
						$html.="<li><a href='customer_info.php'>Customer Information Report</a></li>";
					} if($_SESSION["permission"][$daily_sale_report]["View"]=="1"){ 	
						$html.="<li><a href='report_daily_sale.php'>Daily Sale Report</a></li>";
					} if($_SESSION["permission"][$monthly_sale_report]["View"]=="1"){ 
						$html.="<li><a href='report_monthly_sale.php'>Monthly Sale Report</a></li>";
					}
					$html.="</ul>
					</li>
				</ul>
			</div>
		</div>";
 		echo $html;
	}
	function headerPrint($title){
	$html="<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
		'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
		<html xmlns='http://www.w3.org/1999/xhtml' lang='en' xml:lang='en'>
		<head>
			<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
			<title>".$title."</title>
			<link href='css/jquery-ui-1.8.9.custom.css' rel='stylesheet' type='text/css' />
			<SCRIPT src='js/jquery-1.4.4.min.js'></SCRIPT> 
			<SCRIPT src='js/jquery-ui-1.8.9.custom.min.js'></SCRIPT> 
			<script type='text/javascript' src='./js/superfish.js'></script>
			<script type='text/javascript' src='./js/custom.js'></script>
			<link rel='stylesheet' type='text/css' href='css/menustyle.css' />     
			<link href='css/style.css' rel='stylesheet' type='text/css' />
		</head>
	<body class='layout1014'>
	<INPUT type=hidden value='".$_SESSION['userid']."' id='m_userId' name='m_userId'> 
	<INPUT type=hidden value='".$_SESSION['branchtype']."' id='m_isHo' name='m_isHo'> ";
		echo $html;
	}
	function footer(){
	
		$html="<table width='1024' id='foolter_table' border='0' align='center' cellpadding='0' cellspacing='0'>";
		$html.="<tr valign='top'><td><img src='images/L-Footer.png' width='1024'/></td></tr></table></div></body></html>";
		
		return $html;
	}
	function footer2(){
		$html="<table width='1014' border='0' align='center' cellpadding='0' cellspacing='0'>
  <tr valign='top'>
    <td height='15' colspan='3'><img src='images/MainTable_border_105.jpg' width='37' height='15' /></td>
    <td width='940' height='15' background='images/MainTable_border_106.jpg'><img src='images/0.gif' width='940' height='15' /><br /></td>
    <td height='15' colspan='3'><img src='images/MainTable_border_108.jpg' width='37' height='15' /></td>
  </tr>
  <tr>
    <td width='6'>&nbsp;</td>
    <td width='21'>&nbsp;</td>
    <td width='10'>&nbsp;</td>
    <td>
		<table width='940' border='0' cellspacing='0' cellpadding='0'>
      <!--tr>
        <td width='100' height='20'>&nbsp;</td>
        <td width='500' height='20'>&nbsp;</td>
        <td width='340' height='20'><img src='images/0.gif' width='237' height='20' /></td>
      </tr-->
      <tr>
        <td align='right'>
		<img src='images/ob_footer_logo.jpg'/></td>
        <td class='BlackGray_Tahoma11'><b>&copy; Copyright 2009-201 Oriental Beauty Company Limited. All Rights Reserved</b><br />Call Center 084-777-300,02-4156036-37 ,Fax 02-415-6039</td>  
        <td class='BlackGray_Tahoma11' align='right'><a href='terms.php'><span class='BlackGray_Tahoma11'>Point of Sale</span></a> <b>|</b> Order Product <b>|</b> <a href='#'><span class='BlackGray_Tahoma11'>Receive Product</span></a> <b>|</b> Return Product<br />
          <br /></td>
      </tr>
      
    </table></td>
    <td width='10'>&nbsp;</td>
    <td width='21'>&nbsp;</td>
    <td width='6'>&nbsp;</td>
  </tr>
</table>
 </div>
 </body>";
 $html.="</html>";
return $html;
	}
?>